package com.sicau.controller;

import com.sicau.constants.CommonConstants;
import com.sicau.entity.dto.TaskInfo;
import com.sicau.entity.pojo.vo.ResultVO;
import com.sicau.service.FileService;
import com.sicau.utils.CsvUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Iterator;
import java.util.List;

/**
 * @author ttxxi
 * 文件上传controller
 */

@RestController
@RequestMapping(CommonConstants.NONPUBLIC_PREFIX+"/manager")
public class FileController {

    @Autowired
    FileService fileService;

    @RequestMapping("/image")
    public ResultVO image(HttpServletRequest request){
        return fileService.image(request);
    }

    @RequestMapping("/csv")
    public void updatePayFeeData(HttpServletRequest request) throws Exception {
        fileService.addTasks(request);
    }

}
